{extend name='admin@public/content'}

{block name="content"}
<form autocomplete="off" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>

    <!--{if !empty($managers) && $vo['type']==1}-->
    <div class="form-group">
        <label class="col-sm-2 control-label">经销商</label>
        <div class='col-sm-8'>
            <select name="parent_id" lay-search>
                {foreach $managers as $manager}
                <option {$vo.parent_id==$manager['id']?'selected':''} value="{$manager.id}">{$manager.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <!--{/if}-->

    <div class="form-group">
        <label class="col-sm-2 control-label">名称</label>
        <div class='col-sm-8'>
            <input autofocus name="name" value='{$vo.name|default=""}' title="请输入姓名" placeholder="请输入姓名" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">手机号</label>
        <div class='col-sm-8'>
            <input autofocus name="phone" value='{$vo.phone|default=""}' title="请输入手机号" placeholder="请输入手机号" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label label-required">头像</label>
        <div class='col-sm-8'>
            <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                <thead>
                <tr>
                    <td>图片</td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td class="text-top" style="width:100px">
                        <input type="hidden" name="headimg" value="{$vo.headimg|default=''}">
                        <script>$('[name=headimg]').uploadOneImage()</script>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}<input type="hidden" name="id" value="{$vo.id}">{/if}
            <input type="hidden" name="type" value="{$vo.type|default=1}">
            <button class="layui-btn" type="submit">保存</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消</button>
        </div>
    </div>

    <script>window.form.render();</script>

    <style>
        .background-item {
            padding: 15px;
            background: #efefef;
        }

        .background-item thead tr {
            background: #e0e0e0
        }
    </style>
</form>
{/block}